package org.erepublik.company.thread;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.erepublik.company.product.Raw;
import org.erepublik.company.scanner.RawScanner;

public class RawListener implements ServletContextListener {

    public void contextDestroyed(ServletContextEvent arg0) {
    }

    public void contextInitialized(ServletContextEvent arg0) {
        System.out.println("odpalam watek updatujacy rawy...");
        ProductUpdater<Raw> foodUpdater = new ProductUpdater<Raw>("raw", 1000*60*60, new RawScanner());
        foodUpdater.start();
    }

    public static void main(String[] args) {
        RawListener listener = new RawListener();
        listener.contextInitialized(null);
    }

}